0f34d2f647943640da482e9e0bd2bca6a93385ff,deeplinkdispatch-processor/src/main/java/com/airbnb/deeplinkdispatch/DeepLinkProcessor.java,DeepLinkProcessor,process,#Set#RoundEnvironment#,69
Before Change
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
List<DeepLinkAnnotatedElement> deepLinkElements = new ArrayList<>();
for (Element element : roundEnv.getElementsAnnotatedWith(DeepLinks.class)) {
ElementKind kind = element.getKind();
if (kind != ElementKind.METHOD && kind != ElementKind.CLASS) {
error(element, "Only classes and methods can be annotated with @%s",
DeepLinks.class.getSimpleName());
}
String[] deepLinks = element.getAnnotation(DeepLinks.class).value();
DeepLinkEntry.Type type = kind == ElementKind.CLASS
? DeepLinkEntry.Type.CLASS : DeepLinkEntry.Type.METHOD;
for (String deepLink : deepLinks) {
try {
deepLinkElements.add(new DeepLinkAnnotatedElement(deepLink, element, type));
} catch (MalformedURLException e) {
messager.printMessage(Diagnostic.Kind.ERROR,
"Malformed Deep Link URL " + deepLink);
}
}
}
for (Element element : roundEnv.getElementsAnnotatedWith(DeepLink.class)) {
ElementKind kind = element.getKind();
if (kind != ElementKind.METHOD && kind != ElementKind.CLASS) {
error(element, "Only classes and methods can be annotated with @%s",
DeepLink.class.getSimpleName());
}
DeepLink deepLink = element.getAnnotation(DeepLink.class);
DeepLinkEntry.Type type = kind == ElementKind.CLASS
? DeepLinkEntry.Type.CLASS : DeepLinkEntry.Type.METHOD;
try {
After Change
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
List<DeepLinkAnnotatedElement> deepLinkElements = new ArrayList<>();
for (Element element : roundEnv.getElementsAnnotatedWith(DeepLink.class)) {
ElementKind kind = element.getKind();
if (kind != ElementKind.METHOD && kind != ElementKind.CLASS) {
error(element, "Only classes and methods can be annotated with @%s",
DeepLink.class.getSimpleName());
}
String[] deepLinks = element.getAnnotation(DeepLink.class).value();
DeepLinkEntry.Type type = kind == ElementKind.CLASS
? DeepLinkEntry.Type.CLASS : DeepLinkEntry.Type.METHOD;
for (String deepLink : deepLinks) {